package cn.edu.gdpt.mobile213.mobile2121606097wjc0411;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

public class MainActivity extends AppCompatActivity {
    private RecyclerView rvmainpeople;
    private String[] names={"丁运生","方华高","朱云贵","邹辉","杨文","朱元元","周正文","张伟"};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initview();
        rvmainpeople.setLayoutManager(new LinearLayoutManager(this));
        PeopleAdapter adapter=new PeopleAdapter(names);
        rvmainpeople.setAdapter(adapter);
    }

    private void initview() {
        rvmainpeople=(RecyclerView) findViewById(R.id.rvmainpeople);
    }
}